b626b3e41800a5654ac3b228590c97647485d93e,app/src/main/java/org/kore/kolabnotes/android/fragment/OverviewFragment.java,OverviewFragment,onActivityCreated,#Bundle#,139
Before Change
mSwipeRefreshLayout = (SwipeRefreshLayout) getActivity().findViewById(R.id.swipe_container);
mSwipeRefreshLayout.setColorSchemeColors(getResources().getColor(R.color.theme_accent));
mSwipeRefreshLayout.setRefreshing(true);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
ActiveAccount activeAccount = activeAccountRepository.getActiveAccount();
if(!"local".equalsIgnoreCase(activeAccount.getAccount())) {
Account[] accounts = mAccountManager.getAccountsByType(AuthenticatorActivity.ARG_ACCOUNT_TYPE);
Account selectedAccount = null;
for (Account acc : accounts) {
String email = mAccountManager.getUserData(acc, AuthenticatorActivity.KEY_EMAIL);
if (activeAccount.getAccount().equalsIgnoreCase(email)) {
selectedAccount = acc;
break;
}
}
if(selectedAccount == null){
return;
}
Bundle settingsBundle = new Bundle();
settingsBundle.putBoolean(
ContentResolver.SYNC_EXTRAS_MANUAL, true);
settingsBundle.putBoolean(
ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
ContentResolver.requestSync(selectedAccount,MainActivity.AUTHORITY, settingsBundle);
}else{
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
reloadData();
mSwipeRefreshLayout.setRefreshing(false);
}
});
}
}
});
new InitializeApplicationsTask().execute();
After Change
mSwipeRefreshLayout = (SwipeRefreshLayout) getActivity().findViewById(R.id.swipe_container);
mSwipeRefreshLayout.setColorSchemeColors(getResources().getColor(R.color.theme_accent));
mSwipeRefreshLayout.setRefreshing(true);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
refresh();
}
});
new InitializeApplicationsTask().execute();